package cn.com.icbc.wjl.GWT.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Grid;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;

public class LoginForm implements EntryPoint {

	public void onModuleLoad() {
		Grid grid = new Grid(3, 2);
		grid.setBorderWidth(1);
		grid.setWidget(0, 0, new Label("Username: "));
		grid.setWidget(0, 1, new TextBox());
		grid.setWidget(1, 0, new Label("Password:"));
		grid.setWidget(1, 1, new TextBox());
		grid.setWidget(2, 1, createSubmitButton());
		grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_RIGHT);
		
		RootPanel.get().add(grid);
		
	}

	private Widget createSubmitButton() {
		// TODO Auto-generated method stub
		Button submitButton = new Button();
		submitButton.setText("login");
		return submitButton;
	}

}
